<%@ page import="com.ethereal.petmanagement.entity.User" %>
<%@ page contentType="text/html; charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div class="topbar">
  <div class="logo">爱宠社区</div>
  <div class="nav">
    <a href="../common/home.jsp">首页</a>
    <a href="getPetList.pet">我的宠物</a>
    <a href="../views/petShop.jsp">宠物商城</a>
    <a href="../views/feedShop.jsp">饲料商城</a>
    <a href="../views/order.jsp">我的订单</a>
    <a href="../views/community.jsp">社区论坛</a>
  </div>
  <div class="user-info">
    <%
      User user = (User) session.getAttribute("loginUser");
      if (user.getUsername() != null) {
    %>
    <!-- <img src="<%= user.getAvatarUrl() %>" alt="头像" class="avatar"> -->
    <span class="username"><%= user.getUsername() %></span>
    <a href="logout.user" class="logout-link">退出</a>
    <%
    } else {
    %>
    <a href="../login.jsp" class="login-link">登录</a>
    <%
      }
    %>
  </div>
</div>
